/*
 * @Author: XieQiu 雪球
 * @Date: 2021-05-31 10:47:33
 * @LastEditTime: 2021-05-31 11:22:33
 * @LastEditors: XieQiu 雪球
 * @Description: 岗位管理接口
 */
import xjaxios from "@/api/axios";
export default {
  /**
   * @description: 获取岗位列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getPostList(param) {
    return xjaxios.post("v3/organization/post/queryPageByCondition", param);
  },

  /**
   * @description: 新增岗位信息
   * @param {Object} formData *
   * @return {Object}
   */
  addPostInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo;
    return xjaxios.post("v3/organization/post/add", formData);
  },
  /**
   * @description: 编辑岗位信息
   * @param {Object} formData *
   * @return {Object}
   */
  editPostInfo(formData) {
    return xjaxios.post("v3/organization/post/edit", formData);
  },

  // /**
  //  * @description: 批量删除数据
  //  * @param {Array} list *
  //  * @return {Object}
  //  */
  delPostInfo(list) {
    return xjaxios.get(`v3/organization/post/delListByPostNo?noList=${list}`);
  },
  // /**
  //  * @description: 单个删除数据
  //  * @param {Array} list *
  //  * @return {Object}
  //  */
  delInfo(list) {
    return xjaxios.get(`v3/organization/post/delByPostNo?no=${list}`);
  },
  // /**
  //  * @description: 条件查询所有岗位
  //  * @param null *
  //  * @return {Object}
  //  */
  getPostListByCondition(val) {
    return xjaxios.post("v3/organization/post/queryByCondition", val);
  },

  /**
   * @description: 主键查询岗位信息
   * @param {String} unitId*
   * @return {Object}
   */
  queryPostById(Id) {
    return xjaxios.get(`v3/organization/post/query/${Id}`);
  }
};
